//
//  DonwloadCell.m
//  Leisure
//
//  Created by 大展 on 16/7/5.
//  Copyright © 2016年 大展. All rights reserved.
//

#import "DonwloadCell.h"

@interface DonwloadCell ()
@property (weak, nonatomic) IBOutlet UILabel *progress;

@property (weak, nonatomic) IBOutlet UILabel *title;
@end

@implementation DonwloadCell


- (void)setCellWithModel:(id)model {


    Download *download = model;

    self.title.text = download.title;
    [download downloading:^(long long bytesWritten, float progress) {

        self.progress.text = [NSString stringWithFormat:@"%.2f",progress];

    } didFinished:^(NSString *filePath, NSString *url) {

        self.progress.text = @"下载完成";

    }];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
